<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
	String typeId = request.getParameter("typeId") ;
	String releaseDateStr = request.getParameter("releaseDateStr") ;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div class="data_list">
  		<div class="data_list_title">
		<img src="${pageContext.request.contextPath}/static/images/list_icon.png"/>
		最新博客</div>
  		
  		<div class="datas">
  			<ul>
  				<c:forEach items="${pageInfo.list }" var="blog">
	  				<li style="margin-bottom: 30px">
	  					<span class="date"><a href="${pageContext.request.contextPath}/blog/articles/${blog.blogId }.html"><fmt:formatDate value="${blog.releaseDate }" type="date" pattern="yyyy年MM月dd日"/></a></span>
					  	<span class="title"><a href="${pageContext.request.contextPath}/blog/articles/${blog.blogId }.html">${blog.title }</a></span>
					  	<span class="summary">摘要: ${blog.summary }...</span>
					  	<span class="img">
					  		<c:forEach items="${blog.imageList }" var="image">
					  			<a href="/blog/articles/${blog.blogId }.html">${image }</a>
						  		&nbsp;&nbsp;
					  		</c:forEach>	
					  	</span>
					  	<span class="info">发表于 <fmt:formatDate value="${blog.releaseDate }" type="date" pattern="yyyy-MM-dd HH:mm"/> 阅读(${blog.clickHit }) 评论(${blog.replyHit }) </span>
	  					
	  				</li>
	  				<hr style="height:5px;border:none;border-top:1px dashed gray;padding-bottom:  10px;" />
  				</c:forEach>
  			</ul>
  		</div>
  	</div>
  	
  	<div class="row">
			<!-- 分页文字信息 -->
			<%-- <div class="col-md-6">
				当前第${pageInfo.pageNum }页,
				总${pageInfo.pages }页,
				总共${pageInfo.total }条记录
			</div> --%>
			<!-- 分页样式  -->
			<div class="col-md-6">
				<nav aria-label="Page navigation">
				  <ul class="pagination">
				  	<li><a href="${pageContext.request.contextPath }/index.html?page=1<% 
				  	if(typeId != null) {
				  	%>&typeId=${typeId }<%
				  	}
				  	if(releaseDateStr != null) {
				  	%>&releaseDateStr=${releaseDateStr }<%
				  	}
				  	%>">首页</a></li>
				  	<c:if test="${pageInfo.hasPreviousPage }">
					    <li>
					      <a href="${pageContext.request.contextPath }/index.html?page=${pageInfo.pageNum-1 }<% 
				  	if(typeId != null) {
				  	%>&typeId=${typeId }<%
				  	}
				  	if(releaseDateStr != null) {
				  	%>&releaseDateStr=${releaseDateStr }<%
				  	}
				  	%>" aria-label="Previous">
					        <span aria-hidden="true">&laquo;</span>
					      </a>
					    </li>
				  	</c:if>
				    <c:forEach items="${pageInfo.navigatepageNums }" var="page_Num">
					    <c:if test="${page_Num == pageInfo.pageNum }">
					    	<li class="active"><a href="#">${page_Num }</a></li>
					    </c:if>				    
					    <c:if test="${page_Num != pageInfo.pageNum }">
					    	<li><a href="${pageContext.request.contextPath }/index.html?page=${page_Num }<% 
				  	if(typeId != null) {
				  	%>&typeId=${typeId }<%
				  	}
				  	if(releaseDateStr != null) {
				  	%>&releaseDateStr=${releaseDateStr }<%
				  	}
				  	%>">${page_Num }</a></li>
					    </c:if>				    
				    </c:forEach>
				    <c:if test="${pageInfo.hasNextPage }">
					    <li>
					      <a href="${pageContext.request.contextPath }/index.html?page=${pageInfo.pageNum+1 }<% 
				  	if(typeId != null) {
				  	%>&typeId=${typeId }<%
				  	}
				  	if(releaseDateStr != null) {
				  	%>&releaseDateStr=${releaseDateStr }<%
				  	}
				  	%>" aria-label="Next">
					        <span aria-hidden="true">&raquo;</span>
					      </a>
					    </li>
				    </c:if>
				    <li><a href="${pageContext.request.contextPath }/index.html?page=${pageInfo.pages }<% 
				  	if(typeId != null) {
				  	%>&typeId=${typeId }<%
				  	}
				  	if(releaseDateStr != null) {
				  	%>&releaseDateStr=${releaseDateStr }<%
				  	}
				  	%>">末页</a></li>
				  </ul>
				</nav>
			</div>
		</div>

</body>
</html>